#include "cell.h"
#include <QPainter>
#include <defines.h>

Cell::Cell(Point pos, QGraphicsObject *parent) :
    QGraphicsObject(parent),
    m_color(CellFreeBrush),
    m_pos(pos)
{}

void Cell::paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget)
{
    Q_UNUSED(widget);
    Q_UNUSED(option);
    painter->setBrush(QBrush(m_color));

    painter->drawRect(boundingRect());
    painter->setPen(Qt::darkGray);
    painter->setBrush(Qt::NoBrush);
    painter->drawRect(boundingRect());
}

QRectF Cell::boundingRect() const
{
    return QRectF(xPos(), yPos(), CELL_SIZE, CELL_SIZE);
}
